package com.personal.controller;

import com.personal.controller.result.BackCode;
import com.personal.controller.result.Result;
import com.personal.dao.ParkAreaDao;
import com.personal.domain.ParkArea;
import com.personal.domain.obtain.ParkAreaDireTree;
import com.personal.service.ParkAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @projectName: smartCommunity_springboot
 * @package: com.personal.controller
 * @className: ParkAreaController
 * @author: bong~
 * @description: TODO
 * @date: 2023/8/11 14:23
 * @version: 1.0
 */

@RestController
@RequestMapping("/parkArea")
public class ParkAreaController {


    @Autowired
    private ParkAreaService parkAreaService;

    @GetMapping("/directoryTree")
    public Result getDirectoryTree(){

        List<ParkAreaDireTree> list=parkAreaService.getDirectoryTree(0);
        return new Result(list!=null? BackCode.GET_OK:BackCode.GET_ERR,list);

    }
}
